import {defineStore} from "pinia"

//创建adminInfoState类

//adminStateStore 这个是解构的名字
export const adminStateStore = defineStore({
    id:"adminState",
    state:()=>{
        return{
            adminId:"",
            adminName:"",
            adminAccount:"",
            adminPassword:"",
            adminLoginState:"0",

        };
    },
    getters:{
        getterAdminId(state){
            console.log("AdminInfo被调用输出"+state.adminId)
            return state.adminId;
        },
        getterAdminName(state){
            console.log("AdminInfo被调用输出"+state.adminName)
            return state.adminName;
        },
        getterAdminAccount(state){
            console.log("AdminInfo被调用输出"+state.adminAccount)
            return state.adminAccount;
        },
        getterAdminPassword(state){
            console.log("AdminInfo被调用输出"+state.adminPassword)
            return state.adminPassword;
        },
        getterAdminadminLoginState(state){
            console.log("AdminInfo被调用输出"+state.adminLoginState)
            return state.adminLoginState;
        }
    },
    //setter
    
    actions:{
        setterAdminId(id){
            this.adminId=id
        },
        setterAdminName(name){
            this.adminName=name
        },
        setterAdminAccount(account){
            this.adminAccount=account
        },
        setterAdminPassword(password){
            this.adminPassword=password
        },
        setterAdminLoginState(loginState){
            this.adminLoginState=loginState
        }       
    }
})